import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/Base',
            component: () => import('../components/day1/App1.vue')
        },
        {
            path: '/Directive1',
            component: () => import('../components/day2/App1.vue')
        },
        {
            path: '/Directive2',
            component: () => import('../components/day2/App2.vue')
        },
        {
            path: '/Component',
            component: () => import('../components/day3/Component.vue')
        },
        {
            path: '/TodoList',
            component: () => import('../components/day3/TodoList.vue')
        },
        {
            path: '/Router',
            component: () => import('../Router.vue'),
            children: [
                {
                    path: 'Home',
                    component: () => import('../components/day6/Home.vue')
                },
                {
                    path: 'TypeList',
                    component: () => import('../components/day6/TypeList.vue'),
                    children: [
                        {
                            path:  'Detail/:id',
                            name: 'shangpin',
                            component: () => import('../components/day6/Detail.vue'),
                            props: true
                        },
                    ]
                },
                {
                    path: 'About',
                    component: () => import('../components/day6/About.vue')
                },
                {
                    path: '/Router',
                    redirect: '/Router/Home'
                }
            ]
        },
        {
            path: '/Pinia',
            component: () => import('../Pinia.vue')
        },
        {
            path: '/Ajax',
            component: () => import('../pages/Ajax.vue')
        },
        {
            path: '/Element',
            component: () => import('../pages/Element.vue')
        }
    ]
})

export default router